#!/us/bin/env  node

const koa=require('koa');
const app=new koa(),
      log=console.log;


console.log('hello wangyibo');






app.use(async (ctx,next)=>{//m-logger
   const start=Date.now();
   //let cost=await  next();
   next();
   const end=Date.now();
log(`${ctx.method} ${ctx.path}  ${end-start}ms `);

  
})



app.use((ctx,next)=>{//m.hello


  ctx.body='hello koa';

})


app.listen(8080);
